package com.yc.usercenterbackend.demos.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yc.usercenterbackend.demos.model.domin.Team;
import com.yc.usercenterbackend.demos.model.domin.User;
import com.yc.usercenterbackend.demos.model.dto.TeamQuery;
import com.yc.usercenterbackend.demos.model.request.TeamJoinRequest;
import com.yc.usercenterbackend.demos.model.request.TeamQuitRequest;
import com.yc.usercenterbackend.demos.model.request.TeamUpdateRequest;
import com.yc.usercenterbackend.demos.model.vo.TeamUserVo;

import java.util.List;

/**
* @author 王积有
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-02-03 11:56:04
*/
public interface TeamService extends IService<Team> {

    /**
     * 创建用户
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * team搜索
     *
     * @param teamQuery
     * @param
     * @return
     */
    List<TeamUserVo> listTeams(TeamQuery teamQuery, boolean isAdmin);

    /**
     * 更新队伍
     * @param teamUpdateRequest
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest,User userLogin);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @return
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest,User loginUser);

    /**
     * 用户退出
     * @param teamQuitRequest
     * @param loginUser
     * @return
     */
    Boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 解散队伍
     * @param teamId
     * @param loginUser
     * @return
     */
    boolean deleteTeam(long teamId, User loginUser);
}
